from unittest.case import TestCase
import requests



# Create your tests here.

class ApproveTest(TestCase):
    base_url = 'http://127.0.0.1:8000'

    def full_url(self, path):
        return self.base_url + path

    def test_approve_add(self):
        url = self.full_url('/approve/')
        data = {
            'staff': 'd581f010fe3040198df9744d064b7ada',
            'content': '发现西风酒华山论剑20年 53度有破损20箱，申请返厂更换',
            'kind': '出库',
            'approvers': ['5ebd73384223472997a48dd65699012d', '0e8f8a9eb00d48848e8e5dd75d89968d']
        }
        resp = requests.post(url,json=data)
        print(resp.text)

    def test_approve_update(self):
        url = self.full_url('/approve/')
        data = {
            'staff': '5ebd73384223472997a48dd65699012d',
            'approve': 'd70704bb97ef4270b84c34a5eb478539',
            'idea': '同意',
            'content': '同意，尽快处理'
        }
        resp = requests.put(url,json=data)
        print(resp.text)